#ifndef __XrdDMSimulator_H__
#define __XrdDMSimulator_H__

#include <stdlib.h>

#include "XrdDMSimSiteInfo.hh"
#include "XrdDMSimFileCatalog.hh"
#include "XrdDownloadManager.hh"

class XrdDMSimulator
{
  public:
    XrdDMSimulator();
    ~XrdDMSimulator();
    
    void                GenerateFileCatalog(int numFiles, int sitePerFile);
    void                Simulate(int numEvents);
    void                SetTimeSeed() {srand(time(NULL)); };
    
    XrdDMSimSiteInfo   *AddSite(string name,int minSpeed, int maxSpeed, int percentFailure);
    XrdDMSimSiteInfo   *GetSite(const int &index) {return &fSites[index];}
    XrdDMSimSiteInfo   *GetSiteByName(string name);
    int                 GetSiteRandomSpeed(string index);
    
    int                 GetNumberOfSites() { return fNumSites;}
    XrdDownloadManager *GetDownloadManager() {return &fDownloadManager;}
    XrdDMSimFileCatalog*GetFileCatalog() { return &fFileCatalog;}

    void Print();
    
  private:
    XrdDownloadManager  fDownloadManager;
    int                 fNumSites;
    XrdDMSimFileCatalog fFileCatalog;
    XrdDMSimSiteInfo    fSites[XRDDMSIM_MAX_SITES];

//     void AddFile(XrdDownloadManager *dm,XrdDMSimSiteInfo* site, XrdDownloadManagerFileInfo* file);

};

#endif // __XrdDMSimulator_H__
